package cn.cy.behavior.observer.inter.pattern;

/**
 * @author yangxq
 * @desc
 * @date 2025-05-11
 */
public class Stock extends investment {

    public Stock(String name, double price) {
        this.name = name;
        this.price = price;
        System.out.println("Stock " + name + " price created at " + price);
    }

    public String getName() {
        return name;
    }

    public void setPrice(double price) {
        this.price = price;
        super.notifyObservers();
    }

}
